<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item><a href="#/account">账单列表</a></el-breadcrumb-item>
    </el-breadcrumb>

    <el-card>
      <el-table
        :data="tableData"
        border
        show-summary
        style="width: 100%">
        <el-table-column
          prop="name"
          label="账户"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="balance"
          sortable
          label="余额"
          align="center"
        >
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        tableData: []
      }
    },
    created() {
      this.getAccount()
    },
    methods: {
      getAccount() {
        this.$ajax.get('/account/findAll').then((res) => {
          if (res.data.code === 200) {
            this.tableData = res.data.data
          }
        })
      }
    }
  }
</script>
